import type { PlatformInfo } from './common';
import { VideoBaijiahao } from './video/baijiahao';
import { VideoBilibili } from './video/bilibili';
import { VideoBluesky } from './video/bluesky';
import { VideoDouyin } from './video/douyin';
import { VideoEastmoney } from './video/eastmoney';
import { VideoKuaishou } from './video/kuaishou';
import { VideoOkjike } from './video/okjike';
import { VideoRednote } from './video/rednote';
import { VideoTiktok } from './video/tiktok';
import { VideoToutiaohao } from './video/toutiaohao';
import { VideoWeibo } from './video/weibo';
import { VideoWeiXinChannel } from './video/weixinchannel';
import { VideoXiaoheihe } from './video/xiaoheihe';
import { VideoYoutube } from './video/youtube';
import { VideoZhihu } from './video/zhihu';
import { VideoQiE } from './video/qie';
import { VideoChejiahao } from './video/chejiahao';
import { VideoDewu } from './video/dewu';
import { VideoYiche } from './video/yiche';
import { VideoSohu } from './video/sohu';
import { VideoNetease } from './video/netease';
import { VideoDayu } from './video/dayu';
import { VideoAlipay } from './video/alipay';
import { VideoYidian } from './video/yidian';
import { VideoPinduoduo } from './video/pinduoduo';
import { VideoVivoVideo } from './video/vivovideo';

export const VideoInfoMap: Record<string, PlatformInfo> = {
  VIDEO_BILIBILI: {
    type: 'VIDEO',
    name: 'VIDEO_BILIBILI',
    homeUrl: 'https://member.bilibili.com/',
    faviconUrl: 'https://static.hdslb.com/images/favicon.ico',
    iconifyIcon: 'simple-icons:bilibili',
    platformName: chrome.i18n.getMessage('platformBilibili'),
    injectUrl: 'https://member.bilibili.com/platform/upload/video/frame',
    injectFunction: VideoBilibili,
    tags: ['CN'],
    accountKey: 'bilibili',
  },
  VIDEO_DOUYIN: {
    type: 'VIDEO',
    name: 'VIDEO_DOUYIN',
    homeUrl: 'https://creator.douyin.com/',
    faviconUrl: 'https://lf1-cdn-tos.bytegoofy.com/goofy/ies/douyin_web/public/favicon.ico',
    platformName: chrome.i18n.getMessage('platformDouyin'),
    injectUrl: 'https://creator.douyin.com/creator-micro/content/upload',
    injectFunction: VideoDouyin,
    tags: ['CN'],
    accountKey: 'douyin',
  },
  VIDEO_YOUTUBE: {
    type: 'VIDEO',
    name: 'VIDEO_YOUTUBE',
    homeUrl: 'https://studio.youtube.com/',
    faviconUrl: 'https://www.youtube.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformYoutube'),
    injectUrl: 'https://studio.youtube.com/',
    injectFunction: VideoYoutube,
    tags: ['International'],
    accountKey: 'youtube',
  },
  VIDEO_REDNOTE: {
    type: 'VIDEO',
    name: 'VIDEO_REDNOTE',
    homeUrl: 'https://creator.xiaohongshu.com',
    faviconUrl: 'https://creator.xiaohongshu.com/favicon.ico',
    iconifyIcon: 'simple-icons:xiaohongshu',
    platformName: chrome.i18n.getMessage('platformRednote'),
    injectUrl: 'https://creator.xiaohongshu.com/publish/publish?target=video',
    injectFunction: VideoRednote,
    tags: ['CN'],
    accountKey: 'rednote',
  },
  VIDEO_TIKTOK: {
    type: 'VIDEO',
    name: 'VIDEO_TIKTOK',
    homeUrl: 'https://www.tiktok.com/tiktokstudio',
    faviconUrl: 'https://pic1.zhimg.com/80/v2-9ad49e8e52b473e4c366b69bc9653a45_1440w.png',
    platformName: chrome.i18n.getMessage('platformTiktok'),
    injectUrl: 'https://www.tiktok.com/tiktokstudio/upload',
    injectFunction: VideoTiktok,
    tags: ['International'],
    accountKey: 'tiktok',
  },
  VIDEO_WEIXINCHANNEL: {
    type: 'VIDEO',
    name: 'VIDEO_WEIXINCHANNEL',
    homeUrl: 'https://channels.weixin.qq.com/platform',
    faviconUrl: 'https://res.wx.qq.com/t/wx_fed/finder/helper/finder-helper-web/res/favicon-v2.ico',
    platformName: chrome.i18n.getMessage('platformWeiXinVideo'),
    injectUrl: 'https://channels.weixin.qq.com/platform/post/create',
    injectFunction: VideoWeiXinChannel,
    tags: ['CN'],
    accountKey: 'weixinchannel',
  },
  VIDEO_KUAISHOU: {
    type: 'VIDEO',
    name: 'VIDEO_KUAISHOU',
    homeUrl: 'https://cp.kuaishou.com/',
    faviconUrl: 'https://www.kuaishou.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformKuaishou'),
    injectUrl: 'https://cp.kuaishou.com/article/publish/video',
    injectFunction: VideoKuaishou,
    tags: ['CN'],
    accountKey: 'kuaishou',
  },
  VIDEO_BAIJIAHAO: {
    type: 'VIDEO',
    name: 'VIDEO_BAIJIAHAO',
    homeUrl: 'https://baijiahao.baidu.com/',
    faviconUrl: 'https://pic.rmb.bdstatic.com/10e1e2b43c35577e1315f0f6aad6ba24.vnd.microsoft.icon',
    platformName: chrome.i18n.getMessage('platformBaijiahao'),
    injectUrl: 'https://baijiahao.baidu.com/builder/rc/edit?type=videoV2',
    injectFunction: VideoBaijiahao,
    tags: ['CN'],
    accountKey: 'baijiahao',
  },
  VIDEO_WEIBO: {
    type: 'VIDEO',
    name: 'VIDEO_WEIBO',
    homeUrl: 'https://weibo.com/',
    faviconUrl: 'https://weibo.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformWeibo'),
    injectUrl: 'https://weibo.com/upload/channel',
    injectFunction: VideoWeibo,
    tags: ['CN'],
    accountKey: 'weibo',
  },
  VIDEO_OKJIKE: {
    type: 'VIDEO',
    name: 'VIDEO_OKJIKE',
    homeUrl: 'https://web.okjike.com',
    faviconUrl: 'https://web.okjike.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformOkjike'),
    injectUrl: 'https://web.okjike.com',
    injectFunction: VideoOkjike,
    tags: ['CN'],
    accountKey: 'okjike',
  },
  VIDEO_BLUESKY: {
    type: 'VIDEO',
    name: 'VIDEO_BLUESKY',
    homeUrl: 'https://bsky.app/',
    faviconUrl: 'https://web-cdn.bsky.app/static/favicon-32x32.png',
    platformName: chrome.i18n.getMessage('platformBluesky'),
    injectUrl: 'https://bsky.app/',
    injectFunction: VideoBluesky,
    tags: ['International'],
    accountKey: 'bluesky',
  },
  VIDEO_ZHIHU: {
    type: 'VIDEO',
    name: 'VIDEO_ZHIHU',
    homeUrl: 'https://www.zhihu.com/',
    faviconUrl: 'https://www.zhihu.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformZhihu'),
    injectUrl: 'https://www.zhihu.com/zvideo/upload-video',
    injectFunction: VideoZhihu,
    tags: ['CN'],
    accountKey: 'zhihu',
  },
  VIDEO_EASTMONEY: {
    type: 'VIDEO',
    name: 'VIDEO_EASTMONEY',
    homeUrl: 'https://www.eastmoney.com/',
    faviconUrl: 'https://mycaifuhao.eastmoney.com/public/publish/favicon.ico',
    platformName: chrome.i18n.getMessage('platformEastmoney'),
    injectUrl: 'https://mp.eastmoney.com/collect/pc_writer/index.html#/publish/video',
    injectFunction: VideoEastmoney,
    tags: ['CN'],
    accountKey: 'eastmoney',
  },
  VIDEO_XIAOHEIHE: {
    type: 'VIDEO',
    name: 'VIDEO_XIAOHEIHE',
    homeUrl: 'https://www.xiaoheihe.cn/',
    faviconUrl: 'https://www.xiaoheihe.cn/favicon.ico',
    platformName: chrome.i18n.getMessage('platformXiaoheihe'),
    injectUrl: 'https://www.xiaoheihe.cn/creator/editor/draft/video',
    injectFunction: VideoXiaoheihe,
    tags: ['CN'],
    accountKey: 'xiaoheihe',
  },
  VIDEO_TOUTIAOHAO: {
    type: 'VIDEO',
    name: 'VIDEO_TOUTIAOHAO',
    homeUrl: 'https://www.toutiao.com/',
    faviconUrl: 'https://sf1-cdn-tos.toutiaostatic.com/obj/ttfe/pgcfe/sz/mp_logo.png',
    platformName: chrome.i18n.getMessage('platformToutiaohao'),
    injectUrl: 'https://mp.toutiao.com/profile_v4/xigua/upload-video',
    injectFunction: VideoToutiaohao,
    tags: ['CN'],
    accountKey: 'toutiaohao',
  },
  VIDEO_QIE: {
    type: 'VIDEO',
    name: 'VIDEO_QIE',
    homeUrl: 'https://om.qq.com/',
    faviconUrl: 'https://om.qq.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformQiE'),
    injectUrl: 'https://om.qq.com/main/creation/video',
    injectFunction: VideoQiE,
    tags: ['CN'],
    accountKey: 'qie',
  },
  VIDEO_CHEJIAHAO: {
    type: 'VIDEO',
    name: 'VIDEO_CHEJIAHAO',
    homeUrl: 'https://creator.autohome.com.cn/',
    faviconUrl: 'https://z.autoimg.cn/www/pc/chejiahao/favicon.ico?v=1.3',
    platformName: chrome.i18n.getMessage('platformChejiahao'),
    injectUrl: 'https://creator.autohome.com.cn/web/publish/video',
    injectFunction: VideoChejiahao,
    tags: ['CN'],
    accountKey: 'chejiahao',
  },
  VIDEO_DEWU: {
    type: 'VIDEO',
    name: 'VIDEO_DEWU',
    homeUrl: 'https://creator.dewu.com/',
    faviconUrl: 'https://creator.dewu.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformDewu'),
    injectUrl: 'https://creator.dewu.com/release',
    injectFunction: VideoDewu,
    tags: ['CN'],
    accountKey: 'dewu',
  },
  VIDEO_YICHE: {
    type: 'VIDEO',
    name: 'VIDEO_YICHE',
    homeUrl: 'https://mp.yiche.com/',
    faviconUrl: 'https://www.yiche.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformYiche'),
    injectUrl: 'https://mp.yiche.com/videos/video',
    injectFunction: VideoYiche,
    tags: ['CN'],
    accountKey: 'yiche',
  },
  VIDEO_SOHU: {
    type: 'VIDEO',
    name: 'VIDEO_SOHU',
    homeUrl: 'https://mp.sohu.com',
    faviconUrl: 'https://statics.itc.cn/mp-new/icon/1.1/favicon.ico',
    platformName: chrome.i18n.getMessage('platformSohu'),
    injectUrl: 'https://mp.sohu.com/mpfe/v4/contentManagement/news/addvideo',
    injectFunction: VideoSohu,
    tags: ['CN'],
    accountKey: 'sohu',
  },
  VIDEO_NETEASE: {
    type: 'VIDEO',
    name: 'VIDEO_NETEASE',
    homeUrl: 'http://mp.163.com/',
    faviconUrl: 'https://static.ws.126.net/163/f2e/news/mp_pc_login/resource/static/share-icon.png',
    platformName: chrome.i18n.getMessage('platformNetease'),
    injectUrl: 'http://mp.163.com/subscribe_v4/index.html#/home',
    injectFunction: VideoNetease,
    tags: ['CN'],
    accountKey: 'netease',
  },
  VIDEO_DAYU: {
    type: 'VIDEO',
    name: 'VIDEO_DAYU',
    homeUrl: 'https://mp.dayu.com/',
    faviconUrl: 'https://image.uc.cn/s/uae/g/1v/images/index/favicon.ico',
    platformName: chrome.i18n.getMessage('platformDayu'),
    injectUrl: 'https://mp.dayu.com/dashboard/video/write',
    injectFunction: VideoDayu,
    tags: ['CN'],
    accountKey: 'dayu',
  },
  VIDEO_ALIPAY: {
    type: 'VIDEO',
    name: 'VIDEO_ALIPAY',
    homeUrl: 'https://sweb.alipay.com',
    faviconUrl: 'https://www.alipay.com/favicon.ico',
    platformName: chrome.i18n.getMessage('platformAlipay'),
    injectUrl: 'https://c.alipay.com/page/content-creation/publish/short-video',
    injectFunction: VideoAlipay,
    tags: ['CN'],
    accountKey: 'alipay',
  },
  VIDEO_YIDIAN: {
    type: 'VIDEO',
    name: 'VIDEO_YIDIAN',
    homeUrl: 'https://mp.yidianzixun.com/',
    faviconUrl: 'https://static.yidianzixun.com/img/faviconred.ico',
    platformName: chrome.i18n.getMessage('platformYidian'),
    injectUrl: 'https://mp.yidianzixun.com/',
    injectFunction: VideoYidian,
    tags: ['CN'],
    accountKey: 'yidian',
  },
  VIDEO_PINDUODUO: {
    type: 'VIDEO',
    name: 'VIDEO_PINDUODUO',
    homeUrl: 'https://live.pinduoduo.com/',
    faviconUrl: 'https://mms-static.pinduoduo.com/express/favicon.ico',
    platformName: chrome.i18n.getMessage('platformPinduoduo'),
    injectUrl: 'https://live.pinduoduo.com/creator/live-record',
    injectFunction: VideoPinduoduo,
    tags: ['CN'],
    accountKey: 'pinduoduo',
  },
  VIDEO_VIVOVIDEO: {
    type: 'VIDEO',
    name: 'VIDEO_VIVOVIDEO',
    homeUrl: 'https://kaixinkan.vivo.com.cn/',
    faviconUrl: 'https://www.vivo.com.cn/favicon.ico',
    platformName: chrome.i18n.getMessage('platformVivoVideo'),
    injectUrl: 'https://kaixinkan.vivo.com.cn/#/home',
    injectFunction: VideoVivoVideo,
    tags: ['CN'],
    accountKey: 'vivovideo',
  },
};
